#! /usr/bin/perl
use strict;
use warnings;

###### 
# NGSbox - bioinformatics analysis tools for next generation sequencing data
#
# Copyright 2007-2011 Stephan Ossowski, Korbinian Schneeberger
# 
# NGSbox is free software: you can redistribute it and/or modify it under the 
# terms of the GNU General Public License as published by the Free Software 
# Foundation, either version 3 of the License, or any later version.
#
# NGSbox is distributed in the hope that it will be useful, but WITHOUT ANY 
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 
# FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
#
# Please find the GNU General Public License at <http://www.gnu.org/licenses/>.
#
#  -------------------------------------------------------------------------
#
#  Module: Support::qsub::batch_db_upload.pl
#  Purpose:
#  In:
#  Out:
#


my $usage = "\n$0 infolder\n\n";
my $infolder  = shift or die $usage;

my $samples = "";

my @folders = glob($infolder . "/*");

foreach my $folder (@folders) {

	my @folderpath = split("/", $folder);
	my $folderleaf = $folderpath[$#folderpath];

	if( -e "$folder/shore/map.list.gz" ) {
		$samples .= "$folder/shore/map.list.gz,";
	}
}

chop($samples);

print "shore count -k -o CNV -f /users/GD/projects/HumanDisease/ExomeEnrichment/AgilentSureSelect/35MB_standard/shore_format/SureSelect_All_Exon_G3362_plus0.bed -m $samples\n";

exit(0);
